package lab02.test28;

import java.util.Scanner;

public class Test28 {
    public static void main(String[] args) {

        double area;
        System.out.println("请输入double型的半径：");


        while (true) {

            try {

                Scanner sc = new Scanner(System.in);
                double x = sc.nextDouble();
                area = Math.PI * x * x;
                System.out.println("面积是：" + area);
                break;


            } catch (Exception e) {

                System.out.println("出错：" + e);
                System.out.println("请重新输入double型数据");

                continue;

            }
        }
    }

}
